<?php
include_once("../../metier/question.dao.php");
include_once("../../metier/question.class.php");
header("Content-Type: text/plain");

$db = new myPDO("127.0.0.1", "root", "", 0);
$questionDAO = new QuestionDAO();

$tab = $questionDAO->findAllQuestions($db);

echo "<?xml version='1.0' encoding='UTF-8'?> \n\r" ;
echo "<listeDeQuestions>"."\n\r" ;
foreach($tab as $ligne) {
	echo "\t"."<question>"."\n\r" ;
	echo "\t\t"."<identifiant>".$ligne->getId()."</identifiant>"."\n\r";
	echo "\t\t"."<libelle>".$ligne->getLibelle()."</libelle>"."\n\r";
	echo "\t\t"."<indiceBR>".$ligne->getIndiceBonneReponse()."</indiceBR>"."\n\r";
	echo "\t\t"."<categorie>".$ligne->getCategorie()."</categorie>"."\n\r";
	echo "\t"."</question>"."\n\r";
}
echo "</listeDeQuestions>"."\n\r" ;
?>